package com.nice.app.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nice.app.domain.User;
import com.nice.app.persistence.UserMapper;

@Service
public class UserService {

	@Autowired
	private UserMapper userMapper;

	@Transactional
	public void insertUser(User user) {
		userMapper.insertUser(user);
	}
	
	@Transactional
	public void updateUser(User user) {
		userMapper.updateUser(user);
	}
	
	@Transactional
	public void deleteUser(Long userId) {
		userMapper.deleteUser(userId);
	}
	

	public void deleteUserByIdList(String idList) {
		userMapper.deleteUserByIdList(idList);
	}
	
	public List<User> findUser(){
		return userMapper.findUser();
	}
}
